<?php

if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}


$sql = <<<EOF

DROP TABLE IF EXISTS pre_erling_aics_config;
create table pre_erling_aics_config
(
    id     int auto_increment
        primary key,
    `key`  varchar(50)  null,
    name   varchar(50)  null,
    value  text         null,
    category varchar(50) null,
    `desc` varchar(255) null,
    constraint pre_erling_aics_config_pk
        unique (`key`)
)
    engine = InnoDB;

EOF;

runquery($sql);


$insert_sql = <<<EOF

INSERT INTO pre_erling_aics_config (`key`, name, value, category, `desc`)
VALUES 
('api_key', 'API Key', '', 'basic_settings', 'api密钥'),
('knowledge_structure', '知识库（结构）', '', 'basic_settings', '是否启用知识库（结构）'),
('knowledge_document', '知识库（文档）', '', 'basic_settings', '是否启用知识库（文档）'),
('knowledge_qa', '知识库（众包问答知识）', '', 'basic_settings', '是否启用知识库（用户的问答内容和反馈）'),
('name', '用户称呼', '用户', 'chat_settings', '用户称呼，为空时将调用用户的昵称');

EOF;

runquery($insert_sql);

$finish = TRUE;

?>